

export function checkParam(ctx, by){
  Object.keys(by).map((key)=>{
    
    if (!by[key].test(ctx.request.body[key])){
      console.log(key, ctx.request.body[key], by[key], " Check Failed.");
      ctx.throw(300, "params format error!");
    }else{
      console.log(key, ctx.request.body[key], by[key], " Check Ok.");
    }
  });
}